package thread;

public class SynApiDemo {
    public static void main(String[] args) throws InterruptedException {

        StringBuilder sb = new StringBuilder();
        //StringBuffer sb = new StringBuffer();
        Thread t1 = new Thread(){public void run() {
            for(int i=0;i<100;i++){
                sb.append("hello");
            }
        }
        };

        //StringBuffer sb1 = new StringBuffer();
        StringBuilder sb1 = new StringBuilder();
        Thread t11 = new Thread(){public void run() {
            for(int i=0;i<100;i++){
                sb.append("hello");
            }
        }
        };

        t1.start();
        t11.start();
        Thread.sleep(2000);
        System.out.println(sb.length());
        System.out.println(sb.length());
    }


}
